package com.kevin.elasticjob.event;

import com.google.common.eventbus.Subscribe;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author Kevin Liu
 * @date 2020/7/31 下午3:59
 */
@Component
@EventBusListener
@SuppressWarnings("UnstableApiUsage")
@Slf4j
public class OrderChangeListener {

    @Subscribe
    public void sendMessage(OrderCreatedEvent event) {
        long orderId = event.getOrderId();
        long userId = event.getUserId();
        log.info("send message to the user:{}",userId);
    }


    @Subscribe
    public void sendMail(OrderChangedEvent event) {
        long orderId = event.getOrderId();
        long userId = event.getUserId();
        log.info("send mail to the user:{}",userId);
    }

}
